package com.lzy.cloud.payment.remote;

import com.lzy.cloud.payment.dtos.pay.PayOrderParamsDTO;
import com.lzy.cloud.payment.remote.request.BaseCouponRequest;
import com.lzy.cloud.payment.remote.request.OrderCouponLogRequest;
import com.lzy.cloud.payment.remote.request.OrderExpenseItemRequest;
import com.lzy.framework.core.output.Result;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "lzy-cloud-order")
public interface OrderApi {

    /**
     * 根据订单编号查询订单信息
     *
     * @param orderId
     * @return
     */
    @RequestMapping(value = "/order/find/{orderId}")
    Result findOrderByOrderId(@PathVariable("orderId") String orderId);

    /**
     * 修改订单支付状态
     *
     * @param payOrderParamsDTO
     * @return
     */
    @RequestMapping(value = "/order/pay/update/pay")
    Result updatePayOrderStatus(PayOrderParamsDTO payOrderParamsDTO);

    /**
     * 根据条件查询订单费用项目明细
     * @param request
     * @return
     */
    @RequestMapping(value = "/order/expense/item/query/list",method = RequestMethod.POST)
    Result queryList(OrderExpenseItemRequest request);

    /**
     * 查询订单中券流向记录列表
     * @param request
     * @return
     */
    @RequestMapping(value = "/order/coupon/log/list",method = RequestMethod.POST)
    Result selectList(@RequestBody OrderCouponLogRequest request);

    /**
     * 批量更新订单中券流向记录列表
     * @param request
     * @return
     */
    @RequestMapping(value = "/order/coupon/log/update/many/log",method = RequestMethod.POST)
    Result updateManyLog(@RequestBody OrderCouponLogRequest request, String couponIds);

    /**
     * 取消支付订单，服务调用
     * @param orderId
     * @return
     */
    @RequestMapping(value = "order/cancel/pay/service",method = RequestMethod.POST)
    Result cancelPayService(String orderId);
}
